<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>箭头函数的几种形式</title>
  </head>

  <body>

  </body>
  <script>
    /* 
    箭头函数的几种形式
    */
    //1.无参数无返回
    let fn = () => console.log("我是一个箭头函数");
    fn(); //我是一个箭头函数

    //2.无参数有返回
    let fn1 = () => "hello Vue";
    console.log(fn1()); //hello Vue

    //3.有参数无返回值
    let fn2 = x => console.log(x);
    fn2('world'); //world

    //4.有参数有返回值
    let fn3 = (x, y) => x + y;
    console.log(fn3(1, 1)); //2
  </script>

</html>